home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 112 / EnigmaAmiga112CD.iso / dalla rivista / amiga.free / stargate / install < prev    next >
Text File  |  1999-06-06  |  8KB  |  355 lines

  1. ;       StarGate v2.1 (June 7, 1999)
  2. ; Copyright 1999 by Toysoft Development Inc.
  3. ;           All rights reserved.
  4. ;
  5. ;        http://www.toysoft-dev.com
  6. ;
  7. ;       Programmed by  Danny Y. Wong
  8. ;       
  9. ;       E-Mail: danny@toysoft-dev.com
  10. ;
  11. ;-------------------------------------------
  12. ;       Install script by Frank Fenn
  13. ;       Modified by Danny Y. Wong
  14. ;
  15. ;         http://www.snafu.de/~fenn
  16.  
  17. ; *** prepare installation ***
  18.  
  19. (set @app-name     "StarGate")
  20. (set @default-dest "RAM:")
  21.  
  22. (set #lang_english 0)
  23.  
  24. ; *** init strings ***
  25.  
  26. (set #msg_wrongos (cat "You need at least OS 3.1 run " 
  27.                         @app-name
  28.                   )
  29. )
  30.  
  31. (set #msg_welcome (cat "Welcome to the StarGate v2.1 installation\n\n"
  32.                        "Copyright (c)1999 by Toysoft Develepment Inc.\n"
  33.                        "All rights reserved.\n\n"
  34.                        "Before Installing StarGate you should quit "
  35.                        "StarGate if its running."
  36.                        
  37.                   )
  38. )
  39.  
  40. (set #msg_xxx_dir (cat "Choose StarGate home directory\n"
  41.                        "('StarGate' drawer will be created!)"
  42.                   )
  43. )
  44.  
  45. (set #msg_no_dir  (cat "Required assign \'SG:\' not found\n\n"
  46.                        "Try to install Stargate first before update :)"
  47.                   )
  48. )
  49.  
  50. (set #msg_desthelp     "Select destination directory for StarGate")
  51. (set #msg_what         "What do you want to install?\n(First install requires all)")
  52. (set #msg_start        "Would you like to start StarGate now?")
  53. (set #msg_starthelp    "Do you want to start StarGate right now?")
  54. (set #msg_update       "Do you want to install or update StarGate?")
  55. (set #msg_updatehelp   "Choose update if you have StarGate already installed")
  56. (set #part1            "Program files")
  57. (set #part2            "Documentation (Not included)")
  58. (set #part3            "MUI classes")
  59. (set #part4            "Additional tools")
  60. (set #copy_part1       "Copying program files...")
  61. (set #copy_part2       "Copying docs...")
  62. (set #copy_part3       "Copying MUI classes...")
  63. (set #copy_part4       "Copying tools...")
  64. (set #msg_yes          "Yes")
  65. (set #msg_no           "No")
  66.  
  67. ; *** checking environment ***
  68.  
  69. (set os_ver (getversion "exec.library" (resident)))
  70.  
  71. (if (< os_ver (* 39 65536)) (abort #msg_wrongos))
  72.  
  73. ; *** print welcome message ***
  74.  
  75. (welcome #msg_welcome)
  76.  
  77.  
  78. ; check if StarGate is already installed
  79.  
  80. (if (exists "SG:" (noreq))
  81.       (
  82.         (set what
  83.           (askbool (prompt  #msg_update)
  84.                    (help    #msg_updatehelp)
  85.                    (choices "Install" "Update")
  86.           )
  87.         )
  88.       )
  89.       
  90.       (
  91.  
  92. ; default to Install
  93.  
  94.          (set what 1)
  95.          
  96.       )
  97. )
  98.  
  99.  
  100. (run "avail flush")
  101.  
  102.  
  103. (if (= what 1)
  104.  
  105. ; *** install part ***
  106.  
  107. (
  108.  
  109. ; *** ask for components to install ***
  110.  
  111.   (if (= 0 @user-level)
  112.     (set install_level %001111)
  113.     (set install_level (askoptions
  114.                           (prompt  #msg_what)
  115.                           (help    @askoptions-help)
  116.                           (choices #part1 #part2 #part3 #part4)
  117.                        )
  118.     )
  119.   )
  120.  
  121. ; *** ask for destination ***
  122.  
  123.   (set save_user_level @user-level)
  124.   (user 2)
  125.   (set StarGatedest
  126.     (askdir (prompt  #msg_xxx_dir)
  127.             (help    #msg_desthelp)
  128.             (default @default-dest)
  129.             (disk)
  130.     )
  131.   )
  132.   (set @default-dest (tackon StarGatedest "StarGate"))
  133.   (makedir @default-dest)
  134.   (user save_user_level)
  135.  
  136. ; *** detect what selected for installation ***
  137.  
  138.   (set copy_part1 (BITAND %000001 install_level))
  139.   (set copy_part2 (BITAND %000010 install_level))
  140.   (set copy_part3 (BITAND %000100 install_level))
  141.   (set copy_part4 (BITAND %001000 install_level))
  142.  
  143.  
  144. ; *** Users ***
  145.  
  146. (if copy_part1
  147.   (
  148.     (set new_dest (tackon @default-dest "users"))
  149.  
  150.     (copyfiles (prompt  (cat "Copying users..." new_dest))
  151.                (help    @copyfiles-help)
  152.                (pattern "#?")
  153.                (source  "users")
  154.                (dest    new_dest)
  155.     )
  156.   )
  157. )
  158.  
  159.  
  160. )
  161.  
  162. ; *** update part ***
  163.  
  164.   (
  165.     (if (exists "SG:" (noreq))
  166.       (
  167.         (set @default-dest (expandpath "SG:"))
  168.         (set StarGatedest  (expandpath "SG:"))
  169.  
  170.       )
  171.       (
  172.         (abort #msg_no_dir)
  173.       )
  174.     )
  175.  
  176.     (set copy_part1 1)
  177.     (set copy_part2 1)
  178.     (set copy_part3 1)
  179.     (set copy_part4 1)
  180.   )
  181. )
  182.  
  183. ; *** Main program ***
  184.  
  185. (if copy_part1
  186.   (
  187.     (copyfiles (prompt  (cat #copy_part1 @default-dest))
  188.                (help    @copyfiles-help)
  189.                (pattern "StarGate#?")
  190.                (source  "")
  191.                (dest    @default-dest)
  192.                (confirm)
  193.     )
  194.  
  195. ; *** extra icons ***
  196.  
  197.     (copyfiles (prompt  (cat #copy_part1 StarGatedest))
  198.                (help    @copyfiles-help)
  199.                (pattern "#?.info")
  200.                (source  "/")
  201.                (dest    StarGatedest)
  202.                (confirm)
  203.     )
  204.  
  205.   )
  206. )
  207.  
  208. ; *** Images ***
  209.  
  210. (if copy_part1
  211.   (
  212.     (set new_dest (tackon @default-dest "images"))
  213.  
  214.     (copyfiles (prompt  (cat "Copying images..." new_dest))
  215.                (help    @copyfiles-help)
  216.                (pattern "#?")
  217.                (source  "images")
  218.                (dest    new_dest)
  219.     )
  220.   )
  221. )
  222.  
  223. ; *** Sounds ***
  224.  
  225. (if copy_part1
  226.   (
  227.     (set new_dest (tackon @default-dest "sounds"))
  228.  
  229.     (copyfiles (prompt  (cat "Copying sounds..." new_dest))
  230.                (help    @copyfiles-help)
  231.                (pattern "#?.iff")
  232.                (source  "sounds")
  233.                (dest    new_dest)
  234.     )
  235.   )
  236. )
  237.  
  238.  
  239. ; *** News ***
  240.  
  241. (if copy_part1
  242.   (
  243.     (set new_dest (tackon @default-dest "News"))
  244.  
  245.     (copyfiles (prompt  (cat "Copying News Groups..." new_dest))
  246.                (help    @copyfiles-help)
  247.                (pattern "#?")
  248.                (source  "News")
  249.                (dest    new_dest)
  250.     )
  251.   )
  252. )
  253.  
  254. ; *** Pictures ***
  255.  
  256. (if copy_part1
  257.   (
  258.     (set new_dest (tackon @default-dest "Pictures"))
  259.  
  260.     (copyfiles (prompt  (cat "Copying Pictures..." new_dest))
  261.                (help    @copyfiles-help)
  262.                (pattern "#?")
  263.                (source  "Pictures")
  264.                (dest    new_dest)
  265.     )
  266.   )
  267. )
  268.  
  269. ; *** MUI classes ***
  270.  
  271. (if copy_part3
  272.   (
  273.     (set mui_dest "MUI:libs/MUI")
  274.  
  275.     (foreach "MUI" "#?"
  276.       (copylib   (prompt  (cat #copy_part3 mui_dest))
  277.                  (help    @copylib-help)
  278.                  (source  (tackon "MUI" @each-name))
  279.                  (dest    mui_dest)
  280.                  (confirm)
  281.       )
  282.     )
  283.   )
  284. )
  285.  
  286. ; *** Additional tools ***
  287.  
  288. (if copy_part4
  289.   (
  290.     (set c_dest "C:")
  291.  
  292.     (foreach "C" "#?"
  293.       (copylib   (prompt  (cat #copy_part4 c_dest))
  294.                  (help    @copylib-help)
  295.                  (source  (tackon "C" @each-name))
  296.                  (dest    c_dest)
  297.                  (confirm)
  298.       )
  299.     )
  300.  
  301.     (copyfiles (prompt  (cat #copy_part1 @default-dest))
  302.                (help    @copyfiles-help)
  303.                (pattern "Airmail#?")
  304.                (source  "")
  305.                (dest    @default-dest)
  306.                (confirm)
  307.     )
  308.  
  309.     (copyfiles (prompt  (cat #copy_part1 @default-dest))
  310.                (help    @copyfiles-help)
  311.                (pattern "Read#?")
  312.                (source  "")
  313.                (dest    @default-dest)
  314.                (confirm)
  315.     )
  316.  
  317.   )
  318. )
  319.  
  320.  
  321. (makedir (tackon @default-dest "Inbox"))
  322. (makedir (tackon @default-dest "Files"))
  323. (makedir (tackon @default-dest "Folders"))
  324.  
  325. ; *** make user-startup assigns ***
  326.  
  327. (startup @app-name
  328.   (help   "Add system assign to user-startup")
  329.   (prompt "Add system assign to user-startup")
  330.   (confirm)
  331.   (command (cat "Assign SG: " @default-dest))
  332. )
  333.  
  334.  
  335. (message "StarGate includes the entire News Group already.\n"
  336.          "You do not have to download a complete new group.\n"
  337.          "When using News you can just subscribe to new groups."
  338. )
  339.  
  340. ; *** ask for program start ***
  341.  
  342. (run "assign SG: " @default-dest)
  343.  
  344. (set startpgm
  345.   (askbool (prompt  #msg_start)
  346.            (help    #msg_starthelp)
  347.            (default #msg_no)
  348.            (choices #msg_yes #msg_no)
  349.   )
  350. )
  351.  
  352. (if startpgm
  353.   (run "run >NIL:" (tackon @default-dest "StarGate"))
  354. )
  355.